package com.hh.game.service.gateway.pool;

import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.ThreadPoolExecutor;

public class SingleThreadPool {
    private final static ThreadGroup threadGroup = new ThreadGroup("single-work-thread-group");
    private final static ScheduledExecutorService executorService = new ScheduledThreadPoolExecutor(1,
            //threadFactory
            r -> new Thread(threadGroup, r,
                    "single-work-thread")
            ,
            //RejectedExecutionHandler
            (Runnable r, ThreadPoolExecutor executor) -> {
            });

    public static ScheduledExecutorService get(){
        return executorService;
    }
}
